package com.koala.association;

import com.association.R;
import com.koala.data.AssoConnect;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.Intent;

public class WelcomeActivity extends Activity {

	private int SUCCESS=1;
	private String name;
	private String password;
	Handler handler = new Handler() {

		@Override
		public void handleMessage(android.os.Message msg) {
			WelcomeActivity.this.setResult(msg.what);
			WelcomeActivity.this.finish();
		}
	};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_welcome);
		Intent i=this.getIntent();
		name=i.getStringExtra("name");
		password=i.getStringExtra("password");
		new Thread() {

			@Override
			public void run() {
				Message msg = new Message();
				boolean logined=AssoConnect.Logining(name, password);
				msg.what = AssoConnect.getMessage();
				handler.sendMessage(msg);
			}
		}.start();
	}
}
